package org.example;

class Solution {
    public boolean validMountainArray(int[] arr) {
        int i;
        for (i = 1; i < arr.length; i++) {
            if (arr[i] <= arr[i - 1]) {
                break;
            }
        }
        if (i == 1 || i == arr.length || arr[i] == arr[i - 1]) {
            return false;
        }
        for (; i < arr.length; i++) {
            if (arr[i] >= arr[i - 1]) {
                return false;
            }
        }
        return true;
    }
}

public class Main {
    public static void main(String[] args) {

    }
}